package gb.struct;

public class Pair {
    Polynomial p1, p2;

    public Pair(Polynomial p1, Polynomial p2) {
        super();
        this.p1 = p1;
        this.p2 = p2;
    }

    public Polynomial getP1() {
        return p1;
    }

    public void setP1(Polynomial p1) {
        this.p1 = p1;
    }

    public Polynomial getP2() {
        return p2;
    }

    public void setP2(Polynomial p2) {
        this.p2 = p2;
    }
    
    public String toString() {
        return "(" + p1 + ", " + p2 + ")"; 
    }
    
    public boolean equals(Object ob) {
        if (ob instanceof Pair && ob != null) {
            Pair p = (Pair) ob;
            if (p.getP1().equals(p1) &&
                    p.getP2().equals(p2)) {
                return true;
            } else {
                return false;
            }
        } else {
            return super.equals(ob);
        }
    }
}
